home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-19 | 7.4 KB | 288 lines | [TEXT/MPS ] |
- //# Copyright: © 1993-94 by Apple Computer, Inc., all rights reserved.
- #ifndef _FRAME_
- #define _FRAME_
-
- #ifndef _PSTOBJ_
- #include "PstObj.idl"
- #endif
-
- //==============================================================================
- // Theory of Operation
- //==============================================================================
- /*
- If an XMPPart’s contents needs to become visible, it provides to the embedding
- XMPPart an XMPFrame with a desired frameShape and an XMPCanvas, in which’
- coordinate space the frameShape is defined, and an XMPWindow, in which
- eventually the XMPPart’s contents will be rendered.
-
- The embedding XMPPart’s Part Handler then reshapes the XMPFrame’s bounding
- FrameShape and also sets the ClipShape to be used for clipping drawings or
- cached images rendered within the XMPFrame. It also decides about proper
- alignment within its own space and, therefore, sets the XMPFrame’s External
- Transform (c.f. below) accordingly.
-
- The Part Handler having created an XMPFrame object adds it to the XMPWindow’s
- list of visible XMPFrames.
-
- Invalidation concerns two cases: an XMPFrame’s XMPTransfom or a (partial) area
- of the XMPFrame can be affected as described below.
-
- First, an XMPFrame’s position and shape within its containing Root XMPFrame
- (which is equal to the XMPWindow’s frame) is determined by its Aggregate
- Transfoms, which consists of the Frame’s External and Internal Transform
- pre-composed with the containing Frame’s Aggregate Transforms. For
- mapping a point given in Window coordinates to a frame’s local space, XMPFrame
- transforms it by using its Aggregate Internal Transform. Similarly, for
- representing an XMPShape object, given in a containing Frame’s coordinate
- space, into this Frame’s coordinate space, the given shape becomes transformed
- by applying this Frame’s External Transform. For this release, it is required
- that the local coordinate spaces have the same metric as the Root Frame’s
- canvas. In other words, the Frames’ associated XMPCanvas objects must have the
- same type as the Root Frame’s XMPCanvas object. Independently, a part handler
- can come up with its own private canvases and mappings to the XMPCanvas object
- given to its XMPFrame object.
-
- Whenever a Part Handler for a containing XMPPart changes a contained XMPFrame’s
- External Transform (e.g. moving the XMPFrame to a new position) or the
- XMPFrame’s own Part Handler changes the Internal Transform (e.g. scrolling the
- visible XMPPart contents within the XMPFrame), the XMPFrame’s Aggregate
- Transforms are invalidated or get updated.
-
- Furthermore, to assist a containing Part Handler in finding a fine-tuned
- layout between adjacent contained Frames, the UsedShape, set by its Part, may
- be used by the embedding Part. It describes the XMPShape of an XMPFrame which
- is used by its actual contents, versus the FrameShape, that reflects rather the
- required XMPShape as defined by the contained Part Handler.
-
- ActiveShape, also set by this XMPFrame’s XMPPart’s Part Hanlder, defines the
- area within the UsedShape which reacts to mouse clicks which it receives when
- the Frame is not set to Frozen.
-
- All Shapes are given in their Frame’s local coordinate space.
- */
-
-
- //==============================================================================
- // Types
- //==============================================================================
-
- //==============================================================================
- // Classes defined in this interface
- //==============================================================================
-
- interface ODFrame;
-
- //==============================================================================
- // Classes used by this interface
- //==============================================================================
-
- interface ODFrameFacetIterator;
-
- interface ODCanvas;
- interface ODDraft;
- interface ODFacet;
- interface ODPart;
- interface ODShape;
- interface ODStorageUnit;
- interface ODTransform;
- interface ODDragItemIterator;
- interface ODWindow;
-
-
- //# $$$$$ struct ODPoint;
-
- //==============================================================================
- // ODFrame
- //==============================================================================
-
- interface ODFrame : ODPersistentObject
- {
-
- // getters/setters:
-
- ODFrame GetContainingFrame();
-
- void SetContainingFrame(in ODFrame frame);
-
- ODULong GetFrameGroup();
-
- void SetFrameGroup(in ODULong groupID);
-
- ODBoolean IsRoot();
-
- ODBoolean IsSubframe();
-
- void SetSubframe(in ODBoolean isSubframe);
-
- ODBoolean IsOverlaid();
-
- ODBoolean IsFrozen();
-
- void SetFrozen(in ODBoolean isFrozen);
-
- ODBoolean DoesPropagateEvents();
-
- void SetPropagateEvents(in ODBoolean doesPropagateEvents);
-
- //# part
-
- ODPart GetPart();
-
- void ChangePart(in ODPart part);
-
- ODInfoType GetPartInfo();
-
- void SetPartInfo(in ODInfoType partInfo);
-
- ODTypeToken GetViewType();
-
- void SetViewType(in ODTypeToken viewType);
-
- void ChangeViewType(in ODTypeToken viewType);
-
- ODTypeToken GetPresentation();
-
- void SetPresentation(in ODTypeToken presentation);
-
- void ChangePresentation(in ODTypeToken presentation);
-
- //# facets
-
- void FacetAdded(in ODFacet facet);
-
- void FacetRemoved(in ODFacet facet);
-
- ODFrameFacetIterator CreateFacetIterator();
-
- //# shapes:
-
- //# frame shape
-
- ODShape GetFrameShape();
-
- void ChangeFrameShape(in ODShape shape);
-
- ODShape RequestFrameShape(in ODShape shape);
-
- //# used shape
-
- ODShape GetUsedShape();
-
- void ChangeUsedShape(in ODShape shape);
-
- //# transformations:
-
- ODTransform GetInternalTransform();
-
- void ChangeInternalTransform(in ODTransform transform);
-
- //# drag&drop:
-
- ODBoolean IsDroppable();
-
- void SetDroppable(in ODBoolean isDroppable);
-
- ODBoolean IsDragging();
-
- void SetDragging(in ODBoolean isDragging);
-
- //# linking:
-
- void ContentChanged(in ODChangeID change);
-
- void ChangeLinkStatus(in ODLinkStatus status);
-
- ODLinkStatus GetLinkStatus();
-
- //# invalidation/draw:
-
- void Invalidate(in ODShape invalidShape);
-
- void Validate(in ODShape validShape);
-
- void InvalidateActiveBorder();
-
- void DrawActiveBorder();
-
- //# memory management:
-
- ODStorageUnit CloneTo(in ODDraftKey key,in ODDraft destDraft);
-
- //# ref counting
-
- void Close();
-
- void Remove();
-
-
-
-
- #ifdef __SOMIDL__
- implementation
- {
- override:
- somInit,
- somUninit,
- Purge,
- Externalize,
- Release;
-
- releaseorder:
- GetContainingFrame,
- SetContainingFrame,
- GetFrameGroup,
- SetFrameGroup,
- IsRoot,
- IsSubframe,
- SetSubframe,
- IsOverlaid,
- IsFrozen,
- SetFrozen,
- DoesPropagateEvents,
- SetPropagateEvents,
- GetPart,
- ChangePart,
- GetPartInfo,
- SetPartInfo,
- GetViewType,
- SetViewType,
- ChangeViewType,
- GetPresentation,
- SetPresentation,
- ChangePresentation,
- FacetAdded,
- FacetRemoved,
- CreateFacetIterator,
- GetFrameShape,
- ChangeFrameShape,
- RequestFrameShape,
- GetUsedShape,
- ChangeUsedShape,
- GetInternalTransform,
- ChangeInternalTransform,
- IsDroppable,
- SetDroppable,
- IsDragging,
- SetDragging,
- ContentChanged,
- ChangeLinkStatus,
- GetLinkStatus,
- Invalidate,
- Validate,
- InvalidateActiveBorder,
- DrawActiveBorder,
- CloneTo,
- Close,
- Remove,
- GetFacets,
- CommonInitFrame,
- InitFrame,
- InitFrameFromStorage;
-
-
- };
- #endif
- };
-
- #endif //# _FRAME_
-